def match(a, b):
    return (a == '(' and b == ')') or (a == '[' and b == ']') or (a == '{' and b == '}') or (a == '<' and b == '>')

def opening(a):
    return (a == '(') or (a == '{') or (a == '[') or (a == '<');

s = input()
banka = ""

for c in s:
    if len(banka) == 0:
        banka = banka + c
    else:
        a = banka[-1]
        if match(a, c):
            banka = banka[:-1]
        elif opening(c):
            banka = banka + c

if len(banka) == 0:
    print("yes")
else:
    print("false")